home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / db / esm-3.1 / esm-3 / usr / local / sm / src / diskproc / include / trace.h < prev   
Encoding:
C/C++ Source or Header  |  1996-05-05  |  2.4 KB  |  92 lines

  1. #ifndef _TRACE_H_
  2. #define _TRACE_H_
  3. /*
  4.  *   $RCSfile: trace.h,v $  
  5.  *   $Revision: 1.1.1.1 $  
  6.  *   $Date: 1996/05/04 21:56:07 $      
  7.  */ 
  8. /**********************************************************************
  9. * EXODUS Database Toolkit Software
  10. * Copyright (c) 1991 Computer Sciences Department, University of
  11. *                    Wisconsin -- Madison
  12. * All Rights Reserved.
  13. *
  14. * Permission to use, copy, modify and distribute this software and its
  15. * documentation is hereby granted, provided that both the copyright
  16. * notice and this permission notice appear in all copies of the
  17. * software, derivative works or modified versions, and any portions
  18. * thereof, and that both notices appear in supporting documentation.
  19. *
  20. * THE COMPUTER SCIENCES DEPARTMENT OF THE UNIVERSITY OF WISCONSIN --
  21. * MADISON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION.  
  22. * THE DEPARTMENT DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
  23. * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  24. *
  25. * The EXODUS Project Group requests users of this software to return 
  26. * any improvements or extensions that they make to:
  27. *
  28. *   EXODUS Project Group 
  29. *     c/o David J. DeWitt and Michael J. Carey
  30. *   Computer Sciences Department
  31. *   University of Wisconsin -- Madison
  32. *   Madison, WI 53706
  33. *
  34. *     or exodus@cs.wisc.edu
  35. *
  36. * In addition, the EXODUS Project Group requests that users grant the 
  37. * Computer Sciences Department rights to redistribute these changes.
  38. **********************************************************************/
  39.  
  40. #include "global_trace.h"
  41.  
  42. /*
  43.  *    Macros for tracing
  44.  *
  45.  *    Depend on the global variable Trace for information
  46.  */
  47.  
  48. #ifdef DEBUG
  49.  
  50. #define TRACING        ENABLED
  51.  
  52. #else
  53.  
  54. #define TRACING        DISABLED
  55.  
  56. #endif
  57.  
  58.  
  59. #if TRACING IS_ENABLED
  60.  
  61.  
  62. #define TRACE(_Area, _Level) (                                                    \
  63.                                                                                 \
  64.     (((_Area) & TraceFlags) && (checkTraceLevel(_Area, _Level))) ? (                \
  65.         printf("%s %-22s  line: %4d\n", TraceName, __FILE__, __LINE__),            \
  66.         fflush(stdout)                                                            \
  67.     ) : (TraceFlags)                                                            \
  68. )
  69.  
  70.  
  71. #define TRPRINT(_Area, _Level, _Message) (                                        \
  72.                                                                                 \
  73.     ((_Area & TraceFlags) && (checkTraceLevel(_Area, _Level))) ? (                \
  74.         printf("%s %-22s  line: %4d  ", TraceName, __FILE__, __LINE__),    \
  75.         printf _Message,                                                        \
  76.         printf("\n"),                                                            \
  77.         fflush(stdout)                                                            \
  78.     ) : (TraceFlags)                                                            \
  79. )
  80.  
  81.  
  82. #else
  83.  
  84.  
  85. #define TRACE(_Area, _Level)
  86.  
  87. #define TRPRINT(_Area, _Message, _Level)
  88.  
  89.  
  90. #endif
  91. #endif /* _TRACE_H_ */
  92.